﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DPortAck"
    targetNamespace="http://dportack.codeplex.com/"
    elementFormDefault="qualified"
    xmlns="http://dportack.codeplex.com/"
    xmlns:mstns="http://dportack.codeplex.com/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Tests" type="TestCollection"/>
  <xs:complexType name="Test">
    <xs:sequence>
      <xs:element name="Machines" type="MachineTestCollection" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required"/>
    <xs:attribute name="timeout" type="xs:int" use="optional"/>
  </xs:complexType>
  <xs:complexType name="TestCollection">
    <xs:sequence>
      <xs:element name="Test" type="Test" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MachineTest">
    <xs:sequence>
      <xs:element name="Ports" type="MachinePortTestCollection" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="host" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:complexType name="MachineTestCollection">
    <xs:sequence>
      <xs:element name="Machine" type="MachineTest" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MachinePortTest">
    <xs:attribute name="number" type="xs:int" use="required"/>
    <xs:attribute name="protocol" type="ProtocolType" default="Tcp"/>
    <xs:attribute name="socketType" type="SocketType" default="Stream"/>
  </xs:complexType>
  <xs:complexType name="MachinePortTestCollection">
    <xs:sequence>
      <xs:element name="Port" type="MachinePortTest" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="ProtocolType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Tcp"/>
      <xs:enumeration value="Udp"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="SocketType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Stream"/>
      <xs:enumeration value="Dgram"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
